local Lua__kannihoumian = fk.CreateSkill({
  name = "Lua__kannihoumian",
  --tags = { Skill.Compulsory }
})

Fk:loadTranslationTable {
  ["Lua__kannihoumian"] = "看你后面",
  [":Lua__kannihoumian"] = "回合技，当一名角色使用或打出牌时，你可以翻面对其造成一点伤害。当一名其他角色翻面时，你可以翻面获得其一张手牌并对其造成一点伤害。然后发送：“你再看看你后面呢？”",
  ["#Lua__kannihoumian"] = "看你后面：你可以翻面对 %src 造成1点伤害",
  ["#Lua__kannihoumianFM"] = "看你后面：你可以翻面获得 %src 的一张牌并对其造成1点伤害",
}


Lua__kannihoumian:addEffect(fk.CardUsing, {
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(Lua__kannihoumian.name) and
        player:usedSkillTimes(Lua__kannihoumian.name, Player.HistoryTurn) == 0
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askToSkillInvoke(player,
      { skill_name = Lua__kannihoumian.name, prompt = "#Lua__kannihoumian:" .. target.id })
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:turnOver()
    room:damage {
      from = player,
      to = target,
      damage = 1,
    }
  end,
})


Lua__kannihoumian:addEffect(fk.CardResponding, {
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(Lua__kannihoumian.name) and
        player:usedSkillTimes(Lua__kannihoumian.name, Player.HistoryTurn) == 0
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askToSkillInvoke(player,
      { skill_name = Lua__kannihoumian.name, prompt = "#Lua__kannihoumian:" .. target.id })
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:turnOver()
    room:damage {
      from = player,
      to = target,
      damage = 1,
    }
  end,
})

Lua__kannihoumian:addEffect(fk.BeforeTurnOver, {
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(Lua__kannihoumian.name) and target ~= player and
        player:usedSkillTimes(Lua__kannihoumian.name, Player.HistoryTurn) == 0
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askToSkillInvoke(player,
      { skill_name = Lua__kannihoumian.name, prompt = "#Lua__kannihoumianFM:" .. target.id })
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:turnOver()
    if not target:isNude() then
      local id = room:askToChooseCard(player, {
        target = target,
        flag = "he",
        skill_name = Lua__kannihoumian.name,
      })
      room:obtainCard(player, id, false, fk.ReasonPrey)
    end
    room:damage {
      from = player,
      to = target,
      damage = 1,
    }
    player:chat("你再看看你后面呢？")
  end,
})


return Lua__kannihoumian
